<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<script type="text/javascript">
	$(document).ready(function() {
		$('table.tablesorter').tablesorter({
			widgets : [ 'zebra' ],
			sortList : [ [ 0, 0 ] ],
			headers : {
				28 : {
					sorter : false
				}
			}
		});

		$('.edit-payee-link').click(function() {
			loadDiv('content', 'showEditPayeePersonalInfo.do?id=' + $(this).attr('payeeId'));
		});
	});
</script>

<div id="payeeListDiv" class="hastable" style="overflow: auto">
	<table class="tablesorter">
		<thead>
			<tr>
				<th><spring:message code="payeelist.table.heading.payeeName" /></th>
				<th><spring:message
						code="payeelist.table.heading.payeeAddress1" /></th>
				<th><spring:message
						code="payeelist.table.heading.payeeAddress2" /></th>
				<th><spring:message code="payeelist.table.heading.payeeCity" /></th>
				<th><spring:message code="payeelist.table.heading.payeeState" /></th>
				<th><spring:message code="payeelist.table.heading.payeeZipCode" /></th>
				<th><spring:message code="payeelist.table.heading.payeeCountry" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiarytName" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryAddressLine1" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryAddressLine2" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryCity" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryState" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryZipCode" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryCountry" /></th>
				<th><spring:message
						code="payeelist.table.heading.beneficiaryPhoneNumber" /></th>
				<th><spring:message code="payeelist.table.heading.bankName" /></th>
				<th><spring:message code="payeelist.table.heading.bankCode" /></th>
				<th><spring:message code="payeelist.table.heading.chipsCode" /></th>
				<th><spring:message
						code="payeelist.table.heading.accountNumber" /></th>
				<th><spring:message
						code="payeelist.table.heading.bankAddressLine1" /></th>
				<th><spring:message
						code="payeelist.table.heading.bankAddressLine2" /></th>
				<th><spring:message code="payeelist.table.heading.bankCity" /></th>
				<th><spring:message code="payeelist.table.heading.bankState" /></th>
				<th><spring:message code="payeelist.table.heading.bankZipCode" /></th>
				<th><spring:message code="payeelist.table.heading.bankCountry" /></th>
				<th><spring:message
						code="payeelist.table.heading.intermediaryBank" /></th>
				<th><spring:message
						code="payeelist.table.heading.intermediaryBankCode" /></th>
				<th><spring:message
						code="payeelist.table.heading.specialInstructions" /></th>
				<th><spring:message code="payeelist.table.heading.edit" /></th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${payees}" var="payee">
				<tr>
					<td>${payee.payeeName}</td>
					<td>${payee.payeeAddress1}</td>
					<td>${payee.payeeAddress2}</td>
					<td>${payee.payeeCity}</td>
					<td>${payee.payeestate.displayName}</td>
					<td>${payee.payeeZipCode}</td>
					<td>${payee.payeeCountry}</td>
					<td>${payee.beneficiarytName}</td>
					<td>${payee.beneficiaryAddressLine1}</td>
					<td>${payee.beneficiaryAddressLine2}</td>
					<td>${payee.beneficiaryCity}</td>
					<td>${payee.beneficiaryState}</td>
					<td>${payee.beneficiaryZipCode}</td>
					<td>${payee.beneficiarycountrycode}</td>
					<td>${payee.beneficiaryPhoneNumber}</td>
					<td>${payee.bankName}</td>
					<td>${payee.bankCode}</td>
					<td>${payee.chipsCode}</td>
					<td>${payee.accountNumber}</td>
					<td>${payee.bankAddressLine1}</td>
					<td>${payee.bankAddressLine2}</td>
					<td>${payee.bankCity}</td>
					<td>${payee.bankState}</td>
					<td>${payee.bankZipCode}</td>
					<td>${payee.bankcountrycode}</td>
					<td>${payee.intermediaryBank}</td>
					<td>${payee.intermediaryBankCode}</td>
					<td>${payee.specialInstructions}</td>
					<td><a href="javascript://" class="edit-payee-link"
						payeeId="${payee.id}"><spring:message
								code="payeelist.table.link.edit" /></a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div id="payeeListPager"></div>
</div>


